#include <malloc.h>
#include <iostream>
using namespace std;
#include "sort.h"

void createNumbers( int* const numArray, const int size)
{
	for ( int i=0; i<size+1; i++ )
	{
		*(numArray+i) = rand()%size;
	}

}

void main()
{
	int size = 100;
	int* const data = new int[sizeof(int)*size];
	//int *(data+10)={4,6,15,30,33,39,41,58,97,77};
	int i;
	int kk=10;
	while( kk-- )
	{
		cout<<"--------------------------------------------"<<endl;
		createNumbers(data, size);
		
		for ( i=0; i<size; i++ )
		{
			cout<<*(data+i)<<" ";
		}
		cout<<endl;
		
		llt::heap::heapSort<int>(data, size);
		//sort();
		
		for ( i=0; i<size; i++ )
		{
			cout<<*(data+i)<<" ";
		}
		cout<<endl;
		cout<<"--------------------------------------------"<<endl;
		cout<<endl<<endl;
	}

	if (data != NULL)
	{
		delete []data;
	}
}


